using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class OutBoundMap : EntityTypeConfiguration<OutBound>
	{
		public OutBoundMap()
		{
			// Primary Key
			this.HasKey(t => t.OutBoundID);

			// Properties
			this.Property(t => t.BatchNO)
				.HasMaxLength(20);
				
			this.Property(t => t.OutStationType)
				.IsRequired()
				.HasMaxLength(20);
				
			// Table & Column Mappings
			this.ToTable("OutBound");
			this.Property(t => t.OutBoundID).HasColumnName("OutBoundID");
			this.Property(t => t.OutBoundNO).HasColumnName("OutBoundNO");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.BatchNO).HasColumnName("BatchNO");
			this.Property(t => t.TransferType).HasColumnName("TransferType");
			this.Property(t => t.ToStation).HasColumnName("ToStation");
			this.Property(t => t.ToStationPrincipal).HasColumnName("ToStationPrincipal");
			this.Property(t => t.Operator).HasColumnName("Operator");
			this.Property(t => t.OutStationType).HasColumnName("OutStationType");
			this.Property(t => t.IsPrint).HasColumnName("IsPrint");
			this.Property(t => t.PrintTime).HasColumnName("PrintTime");
			this.Property(t => t.OutBoundStation).HasColumnName("OutBoundStation");
			this.Property(t => t.DeliveryMan).HasColumnName("DeliveryMan");
			this.Property(t => t.DeliveryDriver).HasColumnName("DeliveryDriver");
			this.Property(t => t.OutBoundTime).HasColumnName("OutBoundTime");
			this.Property(t => t.CreatBy).HasColumnName("CreatBy");
			this.Property(t => t.CreatStation).HasColumnName("CreatStation");
			this.Property(t => t.CreatTime).HasColumnName("CreatTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateStation).HasColumnName("UpdateStation");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
		}
	}
}

